3.198 \(\int \cos (c+d x) \sin (c+d x) (a+a \sin (c+d x))^2 \, dx\)

Optimal. Leaf size=55 \[ \frac {a^2 \sin ^4(c+d x)}{4 d}+\frac {2 a^2 \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^2(c+d x)}{2 d} \]

[Out]

1/2*a^2*sin(d*x+c)^2/d+2/3*a^2*sin(d*x+c)^3/d+1/4*a^2*sin(d*x+c)^4/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2833, 12, 43} \[ \frac {a^2 \sin ^4(c+d x)}{4 d}+\frac {2 a^2 \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*Sin[c + d*x]*(a + a*Sin[c + d*x])^2,x]

[Out]

(a^2*Sin[c + d*x]^2)/(2*d) + (2*a^2*Sin[c + d*x]^3)/(3*d) + (a^2*Sin[c + d*x]^4)/(4*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2833

Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)
])^(n_.), x_Symbol] :> Dist[1/(b*f), Subst[Int[(a + x)^m*(c + (d*x)/b)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[
{a, b, c, d, e, f, m, n}, x]

Rubi steps

\begin {align*} \int \cos (c+d x) \sin (c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x (a+x)^2}{a} \, dx,x,a \sin (c+d x)\right )}{a d}\\ &=\frac {\operatorname {Subst}\left (\int x (a+x)^2 \, dx,x,a \sin (c+d x)\right )}{a^2 d}\\ &=\frac {\operatorname {Subst}\left (\int \left (a^2 x+2 a x^2+x^3\right ) \, dx,x,a \sin (c+d x)\right )}{a^2 d}\\ &=\frac {a^2 \sin ^2(c+d x)}{2 d}+\frac {2 a^2 \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^4(c+d x)}{4 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 38, normalized size = 0.69 \[ \frac {a^2 \sin ^2(c+d x) \left (3 \sin ^2(c+d x)+8 \sin (c+d x)+6\right )}{12 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*Sin[c + d*x]*(a + a*Sin[c + d*x])^2,x]

[Out]

(a^2*Sin[c + d*x]^2*(6 + 8*Sin[c + d*x] + 3*Sin[c + d*x]^2))/(12*d)

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 58, normalized size = 1.05 \[ \frac {3 \, a^{2} \cos \left (d x + c\right )^{4} - 12 \, a^{2} \cos \left (d x + c\right )^{2} - 8 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \sin \left (d x + c\right )}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(d*x+c)*(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/12*(3*a^2*cos(d*x + c)^4 - 12*a^2*cos(d*x + c)^2 - 8*(a^2*cos(d*x + c)^2 - a^2)*sin(d*x + c))/d

________________________________________________________________________________________

giac [A]  time = 0.17, size = 45, normalized size = 0.82 \[ \frac {3 \, a^{2} \sin \left (d x + c\right )^{4} + 8 \, a^{2} \sin \left (d x + c\right )^{3} + 6 \, a^{2} \sin \left (d x + c\right )^{2}}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(d*x+c)*(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/12*(3*a^2*sin(d*x + c)^4 + 8*a^2*sin(d*x + c)^3 + 6*a^2*sin(d*x + c)^2)/d

________________________________________________________________________________________

maple [A]  time = 0.10, size = 45, normalized size = 0.82 \[ \frac {\frac {a^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{4}+\frac {2 a^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{3}+\frac {\left (\sin ^{2}\left (d x +c \right )\right ) a^{2}}{2}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*sin(d*x+c)*(a+a*sin(d*x+c))^2,x)

[Out]

1/d*(1/4*a^2*sin(d*x+c)^4+2/3*a^2*sin(d*x+c)^3+1/2*sin(d*x+c)^2*a^2)

________________________________________________________________________________________

maxima [A]  time = 0.30, size = 45, normalized size = 0.82 \[ \frac {3 \, a^{2} \sin \left (d x + c\right )^{4} + 8 \, a^{2} \sin \left (d x + c\right )^{3} + 6 \, a^{2} \sin \left (d x + c\right )^{2}}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(d*x+c)*(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/12*(3*a^2*sin(d*x + c)^4 + 8*a^2*sin(d*x + c)^3 + 6*a^2*sin(d*x + c)^2)/d

________________________________________________________________________________________

mupad [B]  time = 8.51, size = 36, normalized size = 0.65 \[ \frac {a^2\,{\sin \left (c+d\,x\right )}^2\,\left (3\,{\sin \left (c+d\,x\right )}^2+8\,\sin \left (c+d\,x\right )+6\right )}{12\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*sin(c + d*x)*(a + a*sin(c + d*x))^2,x)

[Out]

(a^2*sin(c + d*x)^2*(8*sin(c + d*x) + 3*sin(c + d*x)^2 + 6))/(12*d)

________________________________________________________________________________________

sympy [A]  time = 1.28, size = 63, normalized size = 1.15 \[ \begin {cases} \frac {a^{2} \sin ^{4}{\left (c + d x \right )}}{4 d} + \frac {2 a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {a^{2} \sin ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a \sin {\relax (c )} + a\right )^{2} \sin {\relax (c )} \cos {\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(d*x+c)*(a+a*sin(d*x+c))**2,x)

[Out]

Piecewise((a**2*sin(c + d*x)**4/(4*d) + 2*a**2*sin(c + d*x)**3/(3*d) + a**2*sin(c + d*x)**2/(2*d), Ne(d, 0)),
(x*(a*sin(c) + a)**2*sin(c)*cos(c), True))

________________________________________________________________________________________